<?php

require('httpheader.php');
require('../install/mysqldb.php');
header('Content-Type:application/json; charset=utf-8');

if($cin){
    mysqli_select_db($cin,"hongbao");
    date_default_timezone_set('PRC');
    $userlist = mysqli_query($cin,"SELECT * FROM userinfo");
    // var_dump($userlist);
    $data = array();
    if($userlist->num_rows){
        while($row = $userlist->fetch_row()){
            $result = detectionTime($row[6],$row[0],$cin);
            if(!$result){
                $createtime = date("H:i",$row[6]);
                $list = ["uid"=>$row[0],"imgurl"=>$row[2],"username"=>$row[3],"datetime"=>$createtime,"backpostion"=>$row[4]];
                array_push($data,$list);
                $results = ["code"=>'200'];
            }
            
        }
        $results['data'] = $data;
    
    echo json_encode($results);
    }
}

?>